<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Recommend candidates to job</title>
		<link rel="stylesheet" href="./pages/styles/style2.css" />
	</head>


	<body class="content" style="background-color: #C0C0C0">
		<jsp:directive.include file="Header.jsp" />
		<jsp:directive.include file="Navigation.jsp" />
		<div class="content">
			<div class="content-header">
				<h1>
					Recommend candidates to this job 
					<img src="./pages/images/logo.png" align="right" width="130" height="40">
				</h1>
			</div>
			<div class="content-tag">
			<h1>The Opened Job</h1>
				<ul>
					<li><label>Title:</label> ${job.title}</li>
					<li><label>Number of candidates:</label>${job.maxCandidates }</li>
					<li><label>Owner:</label> ${job.proposer.firstName}${job.proposer.lastName }</li>
					<li><label>Opened:</label> ${job.opened }</li>
				</ul>
			</div>
			<br></br>
			<h1>The Choosable candidates</h1>
			<c:choose>
				<c:when test="${empty candidates}">
					<div class="content-tag">
						<h3>No available candidates!</h3>
					</div>
				</c:when>
				<c:otherwise>
					<c:forEach var="candidate"
						items="${candidates}">
						<form action="./RecommendCandidate" method="post">
						<div class="content-tag">
						<div class="content-tag-header">
										<table>
											<tr>
												<td>
													<h2>${candidate.firstName} ${candidate.lastName}</h2>
												</td>
												<td>
													<input type="hidden" name="candidateId" value="${candidate.id}">
													<input type="submit" name="update" value="Recommend this Candidate">
												</td>
											</tr>
										</table>
									</div>
							<ul>
								<li><label>Phone number:</label> ${candidate.phoneNumber }</li>
								<li><label>Mobile number:</label> ${candidate.mobileNumber }</li>
								<li><label>E-Mail:</label> ${candidate.mail }</li>
								<li><label>Address:</label> ${candidate.address }</li>
								<li><label>Relocation:</label> ${candidate.relocation }</li>
								<li><h3>Interviews</h3> <c:choose>
										<c:when test="${empty candidate.interview }">
											<h4>No available interviews!</h4>
										</c:when>
										<c:otherwise>
											<c:forEach var="interview" items="${candidate.interview}">
												<ul>
													<li><label>With:</label> ${interview.user.firstName}
														${interview.user.lastName} At: ${interview.date }</li>
												</ul>
											</c:forEach>
										</c:otherwise>
									</c:choose></li>
								<li><h3>Comments</h3> <c:choose>
										<c:when test="${empty candidate.comments }">
											<div class="comment-tag">
												<h4>No available comments!</h4>
											</div>
										</c:when>
										<c:otherwise>
											<c:forEach var="comment" items="${candidate.comments}">
												<div class="comment-tag">
													<ul>
														<li><label>Date:</label> ${comment.date }</li>
														<li><label>User:</label> ${comment.user.firstName }
															${comment.user.lastName }</li>
														<li><label>Text:</label> ${comment.conetent }</li>
													</ul>
												</div>
											</c:forEach>
										</c:otherwise>
									</c:choose></li>
							</ul>
						</div>
					</form>	
				</c:forEach>
			</c:otherwise>
		</c:choose>
		</div>
	
	</body>
</html>